Carbon


GetMenuItemIconHandle

Header: Menus.h Carbon status: Supported

Obtains a handle to a menu item’s icon.

OSErr GetMenuItemIconHandle (
    MenuHandle inMenu, 
    SInt16 inItem, 
    UInt8 *outIconType, 
    Handle *outIconHandle
);
inMenu

A handle to the menu that contains the menu item for which you wish to obtain the handle.

inItem

An integer representing the item number of the menu item.

outIconType

Pass a pointer to an unsigned 8-bit value. On return, the value specifies the type of icon ('ICON', 'cicn', 'SICN', icon suite, or IconRef) for which you are obtaining a handle. If the menu item has no icon attached, this parameter will contain kMenuNoIcon. See “Menu Item Icon Type Constants” for descriptions of possible values.

outIconHandle

Pass a pointer to a handle. On return, outIconHandle contains a handle to the icon that is attached to the menu item. If the menu item has no icon attached, this parameter contains nil.

function result

A result code.

DISCUSSION

The GetMenuItemIconHandle function gets the icon handle and type of icon of the specified menu item. If you wish to get a resource-based menu item icon, call GetItemIcon.

See also the function SetMenuItemIconHandle.

VERSION NOTES

This function is available with Appearance Manager 1.0 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when CarbonLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by CarbonLib 1.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)